<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('查看通知公告')" />
	<th:block th:include="include :: summernote-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-notice-edit" th:object="${content}">
            <input id="contentId" name="contentId" th:field="*{contentId}"  type="hidden">
            <div class="form-group">	
                <label class="col-sm-2 control-label">公告标题：</label>
                <div class="col-sm-10">
                    <input id="contentTitle" name="contentTitle" th:field="*{contentTitle}" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">	
                <label class="col-sm-2 control-label">公告内容：</label>
                <div class="col-sm-10">
                    <input id="contentContent" name="contentContent" th:field="*{contentContent}" type="hidden">
                    <div id="editor" class="summernote"></div>
                </div>
            </div>
		</form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: summernote-js" />
    <script type="text/javascript">
        var prefix = ctx + "cms/content";
    
	    $(function() {
		    $('.summernote').summernote({
		    	placeholder: '请输入公告内容',
		    	height : 192,
				lang : 'zh-CN',
				followingToolbar: false,
				callbacks: {
	                onImageUpload: function (files) {
	                    sendFile(files[0], this);
	                }
	            }
		    });
			var content = $("#contentContent").val();
		    $('#editor').summernote('code', content);
	    });
	    

		function submitHandler() {
	        if ($.validate.form()) {
	        	var sHTML = $('.summernote').summernote('code');
				$("#contentContent").val(sHTML);
				$.operate.save(prefix + "/look", $('#form-notice-edit').serialize());
	        }
	    }
	</script>
</body>
</html>
